import React, {Component} from 'react';
import NavBar from '../components/Common/NavBar/NarBar'

class Common extends Component {
	constructor(props) {
		super(props);

		// console.log(this.props);

		// console.log('props', props);
		// console.log('history', props.history);

		this.state = {
			items: [
				{
					path: '/',
					title: '首页',
					iconName: 'icon-shouye',
				},
				{
					path: '/news',
					title: '新闻',
					iconName: 'icon-24gl-newspaper',
				},
				{
					path: '/mine',
					title: '我的',
					iconName: 'icon-mine',
				},
			]
		}
	}

	componentDidMount() {

	}

	render() {
		return (
			<div>
				{
					this.props.meta && this.props.meta.hasNav ? <NavBar history={this.props.history} meta={this.props.meta}/> : null
				}
				{/*<NavBar history={this.props.history} meta={this.props.meta}/>*/}
				{this.props.children}
			</div>
		);
	}
}



// 向当前组件绑定操作方法，params：是否需要向内部传值
export default Common;